//-----------------------------------------------------------------------------
// <copyright file="HTMLService.cs" 
// anjumrizwi@gmail.com           
// </copyright>
//-----------------------------------------------------------------------------
namespace HTMLService
{
    #region Includes
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    
    using System.Web.Script.Services;
    using System.Collections.Specialized;


    #endregion

    /// <summary>
    /// HTMLService is designed to serve the html for Ajax method only
    /// </summary>
    [WebService(Namespace = "http://anjumrizwi.co.in/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.Web.Script.Services.ScriptService]
    public class WebContent : System.Web.Services.WebService
    {
        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidationService"/> class.
        /// </summary>
        public WebContent()
        {
            //Uncomment the following line if using designed components 
            //InitializeComponent(); 
        }
        #endregion

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }


        [WebMethod(EnableSession = true)]
        [System.Web.Script.Services.ScriptMethod(UseHttpGet = true)]
        public ServerResponse GetTestHtml(string UserSelectedSearchType)
        {
            ServerResponse response = new ServerResponse();
            try
            {
                response.OutputHtml = UIHelper.GetHTML(UserSelectedSearchType);
            }
            catch (Exception ex)
            {
                response.Error = ex.Message;
            }

            return response;
        }

        [WebMethod(EnableSession = true)]
        [System.Web.Script.Services.ScriptMethod(UseHttpGet = true)]
        public ServerResponse RenderOrderControl(string selectedSearchType)
        {
            ServerResponse response = new ServerResponse();
            try
            {
                response.OutputHtml = UIHelper.RenderOrderControl(selectedSearchType);
            }
            catch (Exception ex)
            {
                response.Error = ex.Message;
            }

            return response;
        }
    }
}